<?php
namespace Summer\Hjd\Http\Requests;

use Summer\Hub\Http\Requests\Request;
use Input;
class ForgotPwdRequest extends Request
{

    /**
     * {@inheritDoc}
     */
    public function data()
    {
        $data = Input::all();
        //默认修改登录密码
        $data['type'] = $data['type']??'login';
        return $data;
    }
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'mobile' => 'required|mobile',
            'code' => 'required',
            'password' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'mobile.required'    => '手机号不能为空.',
            'mobile.mobile'    => '手机号格式错误.',
            'code.required'    => '验证码不能为空.',
            'password.required'    => '新密码不能为空.',
        ];
    }
}
